package com.example.lemis.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.lemis.model.domain.FkBannerDivision;
import com.example.lemis.mapper.FkBannerDivisionMapper;
import com.example.lemis.model.dto.BannerDTO;
import com.example.lemis.service.IFkBannerDivisionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 管理行政区划使用了哪些版面图片，n:m 服务实现类
 * </p>
 *
 * @author lxp
 * @since 2025-06-24
 */
@Service
public class FkBannerDivisionServiceImpl extends ServiceImpl<FkBannerDivisionMapper, FkBannerDivision> implements IFkBannerDivisionService {

    @Autowired
    private FkBannerDivisionMapper fkBannerDivisionMapper;

    @Override
    public FkBannerDivision update_division_banner(FkBannerDivision fkBannerDivision) {
        fkBannerDivisionMapper.update_division_banner(fkBannerDivision);
        LambdaQueryWrapper<FkBannerDivision> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(FkBannerDivision::getBanId, fkBannerDivision.getBanId()).eq(FkBannerDivision::getDivisionId, fkBannerDivision.getDivisionId());
        return fkBannerDivisionMapper.selectOne(lambdaQueryWrapper);
    }

    @Override
    public BannerDTO search_division_banner(BannerDTO bannerDTO) {
        BannerDTO bannerDTO1 = fkBannerDivisionMapper.search_division_banner(bannerDTO);
        return bannerDTO1;
    }
}
